﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Framework.Db;

namespace DAL.Service
{
    /// <summary>
    /// 用户服务
    /// </summary>
    public class userService : DbBase
    {
        Model.userModel user = new Model.userModel();
        List<Model.userModel> l = new List<Model.userModel>();

        public userService()
        {
            this.tb = user.tb;
            l.Clear();
        }

        /// <summary>
        /// 用户登录操作
        /// </summary>
        /// <param name="user">用户实体</param>
        /// <returns>布尔</returns>
        public bool UserLogin(Model.userModel user)
        {
            try
            {
                string sql = string.Format("SELECT count(*) from AUCTION_USER a ,BIDUSER b where a.BIDUSER_NO IN (select BIDUSER_NO from BIDUSER where LOGIN_NAME='{0}') AND a.AUCTION_USERPASSWORD='{1}' AND a.SEATNUMBER='{2}'", user.Auction_USERLOGINNAME, user.Auction_USERPASSWORD, user.Seat_NUMBER);
                int rel =Convert.ToInt32(this.queryOneSQL(sql));
                return rel > 0 ? true : false;

            }catch(Exception ex)
            {
                Framework.Kit.other.WriteErrLog("用户登录操作",ex);
                return false;
            }
        }
    }
}
